<%@page import="java.util.List"%>
<%@page import="com.aring.bean.BattleInfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
	<title>约战</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link href="../css/battleList.css" rel="stylesheet" type="text/css" media="screen">
		<script type="text/javascript" src="../js/jquery-1.9.0.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$('a').click(function(){
					if($(this).parent().parent().next().is(':hidden')){
						$(this).parent().parent().next().show();
					}
					else
						$(this).parent().parent().next().hide();
				})
			})
		</script>
	</head>
	<body>
		<ul id="nav">
			<h2 class="R-h2"><span>当前位置：<a href="../index.jsp">首 页</a> &gt; <a href="#">约战列表</a></span><label>约战列表</label></h2> 
		</ul>
		<div class="Main" style="margin-top: 10px;">
			    <ul class="News_ul"> 
			    <li><span class="Title">约战标题</span>发布时间</li> 
			    <% int pageNumber = Integer.valueOf(request.getParameter("page"));		    
			        List<BattleInfo> battleInfos = (List<BattleInfo>)session.getAttribute("battleInfos");
			        if(battleInfos!=null){
			        for(int i = 0; i<battleInfos.size();i++){
			        	BattleInfo battleInfo = battleInfos.get(i);  
			    %>
			     <li><span class="Title"><a href="javscript:void(0);" ><%=battleInfo.getContent()%></a></span><%=battleInfo.getPublicTime().toLocaleString()%></li> 
			     <div  style="display:none;">
			     	<span>详细信息</span>
			     	<span>约战地址：</span><span><%=battleInfo.getPlace() %></span>
			     	<span>联系方式：</span><span><%=battleInfo.getContact() %></span>
			     	<span>约战时间：</span><span><%=battleInfo.getBattleTime().toString() %></span>
			     </div>
			    <%}} %> 
			    </ul> 
			    <div class="Page"> 
			     <span>共<%=(battleInfos==null)?0:battleInfos.size()%>条</span>
			     <span>当前第<%=pageNumber%>页</span>
			     <a href="../getBatteInfo.do?pageName=redirect:user/battleList.jsp&page=1" class="Num">首页</a>
			     <a href="../getBatteInfo.do?pageName=redirect:user/battleList.jsp&page=<%=pageNumber-1%>" class="Num">上一页</a> 
			     <a href="../getBatteInfo.do?pageName=redirect:user/battleList.jsp&page=<%=pageNumber+1%>" class="Num">下一页</a> 
			    </div> 
		</div>
	</body>
</html>